package com.zb.mobile.controller;

import com.zb.exception.VendorIdentifierException;
import com.zb.result.PageUtil;
import com.zb.result.Result;
import com.zb.service.ZjSysSetOverallService;
import com.zb.utils.TokenMobileUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;

/**
 * @Author WEN
 * @Date 2023/11/22 0022
 **/
@Api(tags = "移动端设置类接口")
@RestController
@RequestMapping("/mobile")
public class MobileSetController {
    @Resource
    private ZjSysSetOverallService sysSetOverallService;

    @ApiOperation("获取地址等级")
    @GetMapping("/getAddressLevel")
    public Result getAddressLevel(HttpServletRequest request) throws VendorIdentifierException {
        Long custAccId = TokenMobileUtil.getCustAccId(request);
        return Result.success("获取地址等级").data(PageUtil.row(sysSetOverallService.getAddressLevel(custAccId)));
    }
}
